import Login from '../views/login/login'
import Detail from '../views/detail/detail'
import Order from '../views/order/order'
import ProductList from '../views/product-list/product-list'
import Main from '../views/main/index'
import Home from '../views/main/home/home'
import Classify from '../views/main/classify/classify'
import Find from '../views/main/find/find'
import Car from '../views/main/car/car'
import My from '../views/main/my/my'

export interface RouteItem{
    path:string,
    component?:any,
    redirect?:string,
    children?:RouteItem[]
}

let routes:RouteItem[] = [
    {
        path:'/main',
        component:Main,
        children:[
            {
                path:'/main/home',
                component:Home,
            },
            {
                path:'/main/my',
                component:My
            },
            {
                path:'/main/classify',
                component:Classify
            },
            {
                path:'/main/find',
                component:Find
            },
            {
                path:'/main/car',
                component:Car
            },
            {
                path:'/main/my',
                component:My
            },
            {
                path:'/main',
                redirect:'/main/home'
            }
        ]
    },
    {
        path:'/login',
        component:Login
    },
    {
        path:'/detail',
        component:Detail
    },
    {
        path:'/order',
        component:Order
    },
    {
        path:'/productList/:id',
        component:ProductList
    },
    {
        path:'/',
        redirect:'/main'
    }
]

export default routes